package com.spring.boot.listener;

import com.spring.boot.event.TestEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;

/**
 * @author: zihong.zheng
 * @date: 2021/5/27 9:48 下午
 */
@Component
@EnableAsync
public class TestApplicationListener1 implements ApplicationListener<TestEvent> {


    @Override
    public void onApplicationEvent(TestEvent event) {
        String message = event.getMessage();
        System.out.println("listener1"+message);
    }
}
